﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Icoders.MarketTracker.Core.MasterData;

namespace Icoders.MarketTracker.Core.Repository.MasterDataRepositories.UserRepositories
{
    public interface  IUserGroupRoleRepository : IBaseRepository<UserGroupRole>
    {
        UserGroupPlaceHolder GetPlaceHolder(int groupID);
    }

    public class UserGroupPlaceHolder
    {
        public UserGroupPlaceHolder()
        {
            Rows = new List<UserGroupRoleView>();
        }
        public List<UserGroupRoleView> Rows { get; set; }
        public int GroupId { get; set; }
        public string GroupName { get; set; }
    }
    public class UserGroupRoleView
    {
        public int Id { get; set; }
        public int RoleId { get; set; }
        public bool CanAccess { get; set; }
        public string RoleName { get; set; }
        public string Value { get { return Id.ToString() + "," + RoleId.ToString(); } }
        public string Checked
        {
            get { if (CanAccess){ return "CHECKED";} else{ return "";} }
        }
    }
}
